package com.tai.design.builder.demo1;

/**
 * The type Director.
 *
 * @version v1.0
 * @ClassName: Director
 * @Description: 指挥者类
 * @Author: taylor
 */
public class Director {

    //声明builder类型的变量
    private Builder builder;

    /**
     * Instantiates a new Director.
     *
     * @param builder the builder
     */
    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * Construct bike.
     *
     * @return the bike
     */
//组装自行车的功能
    public Bike construct() {
        builder.buildFrame();
        builder.buildSeat();
        return builder.createBike();
    }
}
